package com.mall.user.services;

import com.alibaba.fastjson.JSON;
import com.mall.user.ILoginOutService;
import com.mall.user.constants.SysRetCodeConstants;
import com.mall.user.dto.UserLoginOutResponse;
import com.mall.user.utils.ExceptionProcessorUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.stereotype.Component;

/**
 * @Classname LoginOutServiceImpl
 * @Description NULL
 * @Date 2021/5/24 13:23
 * @Created by virus
 */
@Service
@Slf4j
@Component
public class LoginOutServiceImpl implements ILoginOutService {

    @Override
    public UserLoginOutResponse loginOut() {
        UserLoginOutResponse response = new UserLoginOutResponse();
        try {
            response.setCode(SysRetCodeConstants.SUCCESS.getCode());
            response.setMsg(SysRetCodeConstants.SUCCESS.getMessage());
            log.info("用户登出成功");
        } catch (Exception e) {
            log.error("LoginOutServiceImpl.loginOut occur Exception : " + e);
            ExceptionProcessorUtils.wrapperHandlerException(response, e);
        }
        return response;
    }
}
